<?php
namespace app\api\validate;

use think\Validate;

class Base extends Validate
{
    public function goToCheck($data){
        $result=$this->batch()->check($data);
        if(!$result){
            $arr=$this->error;
            $str='';
            foreach ($arr as $k=>$v){
                $str .=$v;
                break;
            }
            exit(json_encode(['code'=>204,'msg'=>$str]));
        }else{
            return true;
        }
    }

}
?>